package Model;

//
//import java.sql.Timestamp;
//
//import Custom.Encrypt;

public class User implements Comparable<User> {



	public int Id, Abonnement;
	private String firstName, insertion, surename, emailAdres, zipcode, adres, city, registratieDatum, password, phonenumber;
	private Accounts huidigeRekeningen;
	
	
	
	public User(String registratieDatum,
			String firstName, String insertion,
			String surename, String password, String emailAdres,
			String phonenumber, String zipcode,
			String adres, String city, int Abonnement) {
		
		this.registratieDatum = registratieDatum;
		this.firstName = firstName;
		this.insertion = insertion;
		this.surename = surename;
		this.password = password;
		this.emailAdres = emailAdres;
		this.phonenumber = phonenumber;
		this.zipcode = zipcode;
		this.adres = adres;
		this.city = city;
		this.Abonnement = Abonnement;
	}
	public User() {
	
	}
	public String getregistratieDatum() {
		return registratieDatum;
	}
	public void setregistratieDatum(String registratieDatum) {
		this.registratieDatum = registratieDatum;
	}
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getinsertion() {
		return insertion;
	}
	public void setinsertion(String insertion) {
		this.insertion = insertion;
	}
	public String getsurename() {
		return surename;
	}
	public void setsurename(String surename) {
		this.surename = surename;
	}
	public String getpassword() {
		return password;
	}
	public void setpassword(String password) {
		this.password = password;
	}
	public String getemailAdres() {
		return emailAdres;
	}
	public void setemailAdres(String emailAdres) {
		this.emailAdres = emailAdres;
	}
	public String getphonenumber() {
		return phonenumber;
	}
	public void setphonenumber(String phonenumber) {
		this.phonenumber = phonenumber;
	}
	public String getzipcode() {
		return zipcode;
	}
	public void setzipcode(String zipcode) {
		this.zipcode = zipcode;
	}
	public String getadres() {
		return adres;
	}
	public void setadres(String adres) {
		this.adres = adres;
	}
	public Integer getAbonnement() {
		return Abonnement;
	}
	public void setAbonnement(Integer Abonnement) {
		this.Abonnement = Abonnement;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public Accounts getHuidigeRekeningen() {
		return huidigeRekeningen;
	}
	public void setHuidigeRekeningen(Accounts huidigeRekeningen) {
		this.huidigeRekeningen = huidigeRekeningen;
	}
	
	public int compareTo(User o) {
		if(surename.compareTo(o.getsurename()) ==  0){
			if(firstName.compareTo(o.getFirstName()) == 0){
				if(emailAdres == o.getemailAdres()){
					return 0;
				}
			}
			return firstName.compareTo(o.getFirstName());
		}
		return surename.compareTo(o.getsurename());
	}
	@Override
	public String toString() {
		return firstName + ",  " + surename + " " + insertion + ";";
	}
	
	@Override
	public boolean equals(Object obj) {
		User temp = (User) obj;
		return compareTo(temp) == 0;
	}
	
	@Override
	public int hashCode() {
		return Id;
	}
	public boolean addRekening(Account r){
		return huidigeRekeningen.save(r);
	}
	
	

}